--简答
/*
===========================================================
|   创建一个名为 Stock_Received表
============================================================
*/
CREATE TABLE Stock_Received
(
       Stock_ID VARCHAR2(5) NOT NULL,
       Stock_Date DATE NOT NULL,
       Cost NUMBER (10)
)
PARTITION BY RANGE(Stock_Date)
(
          PARTITION S1 VALUES LESS THAN (TO_DATE('2019-10-01','yyyy-mm-dd')),
          PARTITION S2 VALUES LESS THAN (TO_DATE('2019-11-01','yyyy-mm-dd')),
          PARTITION Y2 VALUES LESS THAN (MAXVALUE)
);


/*
============================================================
|                     创建序列
============================================================
*/
CREATE SEQUENCE myseq
       START WITH 1000
       INCREMENT BY 10
       MAXVALUE 1100
       NOCYCLE
       CACHE 30;
       

/*
============================================================
|                     插入一条数据
============================================================
*/
INSERT INTO Stock_Received VALUES (myseq.nextval,sysdate,5000);

/*
============================================================
|                    创建公有同义词p_Stock_Received
============================================================
*/
CREATE PUBLIC SYNONYM p_Stock_Received FOR Stock_Received;


/*
============================================================
|                    通过A_oe用户访问
============================================================
*/
SELECT * FROM p_Stock_Received;


/*
============================================================
|                   创建范围分区表
============================================================
*/
PARTITION BY RANGE(Stock_Date)
(
          PARTITION S1 VALUES LESS THAN (TO_DATE('2019-10-01','yyyy-mm-dd')),
          PARTITION S2 VALUES LESS THAN (TO_DATE('2019-11-01','yyyy-mm-dd')),
          PARTITION Y2 VALUES LESS THAN (MAXVALUE)
);

/*
============================================================
|                   创建唯一索引
============================================================
*/
CREATE UNIQUE INDEX index_unique_ID ON Stock_Received(Stock_ID);
